<template>
  <div class="about">
    <h1>This is an about page</h1>
    <input type="button" value="加载分类" @click="findTypeList()" />
    <ul>
      <li v-for="(item, i) in types" :key="i">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
import { loadTypeList } from "../api/real2";
export default {
  data() {
    return {
      types: [],
    };
  },
  methods: {
    async findTypeList() {
      let { code, data, msg } = await loadTypeList();
      this.types = data;
    },
  },
  async created() {
    this.findTypeList();
  },
};
</script>
